package ice.utils;

import java.util.Collections;
import java.util.Enumeration;
import java.util.Properties;
import java.util.Vector;

/**
 * SortedProperties
 * 
 * @author abiao
 */
public class SortedProperties extends Properties {

    /**
     * serialVersionUID
     */
    private static final long serialVersionUID = -4612195583745253330L;

    @SuppressWarnings({ "unchecked", "rawtypes" })
    @Override
    public synchronized Enumeration keys() {
        Enumeration keyEnum = super.keys();
        Vector keys = new Vector();
        while (keyEnum.hasMoreElements()) {
            keys.add(keyEnum.nextElement());
        }
        Collections.sort(keys);
        return keys.elements();
    }
}
